//
//  CashierNavBar.m
//  DiningCar-Business
//
//  Created by 吕晶 on 2020/4/13.
//  Copyright © 2020 吕晶. All rights reserved.
//

#import "CashierNavBar.h"
#import "GCBSearchBar.h"

@interface CashierNavBar ()<GCBSearchBarDelegate>

@property (nonatomic, strong) UILabel *titleLab;
@property (nonatomic, strong) UIButton *quDanBtn;
@property (nonatomic, strong) UIButton *guaQiBtn;
@property (nonatomic, strong) GCBSearchBar *searchBar;

@end

@implementation CashierNavBar

- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        self.backgroundColor = [UIColor whiteColor];
        self.titleLab = [[UILabel alloc] initWithFrame:CGRectMake(15, NaviHeight - 8 - 22, 100, 22)];
        self.titleLab.textColor = HexColor(0x2B2C44);
        self.titleLab.font = BoldFontOfSize(20);
        self.titleLab.text = @"收银台";
        [self addSubview:self.titleLab];
        
        self.guaQiBtn = [UIButton new];
        self.guaQiBtn.nim_left = ScreenW - 15 - 52;
        self.guaQiBtn.nim_top = self.titleLab.nim_top - 2;
        self.guaQiBtn.nim_width = 52;
        self.guaQiBtn.nim_height = 28;
        [self.guaQiBtn setBackgroundColor:HexColor(0xEAEAF1)];
        self.guaQiBtn.layer.cornerRadius = 4;
        [self.guaQiBtn setTitle:@"挂起" forState:0];
        [self.guaQiBtn setTitleColor:HexColor(0x3D3E5A) forState:0];
        self.guaQiBtn.titleLabel.font = BoldFontOfSize(14);
        [self addSubview:self.guaQiBtn];
        
        self.quDanBtn = [UIButton new];
        self.quDanBtn.nim_left = self.guaQiBtn.nim_left - 10 - 52;
        self.quDanBtn.nim_top = self.titleLab.nim_top - 2;
        self.quDanBtn.nim_width = 52;
        self.quDanBtn.nim_height = 28;
        [self.quDanBtn setBackgroundColor:HexColor(0xEAEAF1)];
        self.quDanBtn.layer.cornerRadius = 4;
        [self.quDanBtn setTitle:@"取单" forState:0];
        [self.quDanBtn setTitleColor:HexColor(0x3D3E5A) forState:0];
        self.quDanBtn.titleLabel.font = BoldFontOfSize(14);
        [self addSubview:self.quDanBtn];
        
        self.searchBar = [GCBSearchBar searBarWithFrame:CGRectMake(0, NaviHeight, ScreenW, GCBSearchBarHeight) placeholder:@"请输入商品名称" cancelShowType:GCBSearchBarCancelShowTypeEditing delegate:self];
        self.searchBar.textColor_placeholder = HexColor(0x9E9FB5);
        [self addSubview:self.searchBar];
    }
    return self;
}

@end
